const { defineConfig } = require("@vue/cli-service");
const IS_PROD = ["production", "test"].includes(process.env.NODE_ENV);
module.exports = defineConfig({
  transpileDependencies: true,
  publicPath: "/", // 设置静态资源的访问路径
  outputDir: "dist", // 设置编译后代码的存放路径
  assetsDir: "static",
  lintOnSave: false,
  devServer: {
    port: "3002",
    // https: true,
    hot: true, //自动保存
    liveReload: false,
    client: {
      overlay: false,
    },
    proxy: {
      "/video": {
        target: "https://tb.unimlink.com:8443/videosurvey", //测试
        changeOrigin: true,
        pathRewrite: {
          "^/video": "/",
        },
      },
    },
  },
  configureWebpack: {
    resolve: {
      alias: {
        assets: "@/assets",
        components: "@/components",
        api: "@/api",
      },
    },
  },
  css: {
    // extract: false,
    sourceMap: false,
    loaderOptions: {
      // sass: {
      //   // 这里的选项会传递给 sass-loader
      //   // 使其在文件变更时强制重新编译
      //   implementation: require("sass"),
      //   sassOptions: {
      //     // fiber: require("fibers"),
      //     // force 属性是必须的
      //     force: true,
      //   },
      // },
    },
  },
});
